<template>
	<div>
		<!-- <div class="flex justify_content_between">
			<el-button size="small" type="primary" @click="add">创建</el-button>
			<div class="flex align_items_center">
				<span class="m_r_10">语言:</span>
				<el-select v-model="language" size="small" @change="getTableData">
					<el-option label="cn" value="cn">cn</el-option>
					<el-option label="en" value="en">en</el-option>
				</el-select>
			</div>
		</div> -->
		<div class="flex justify_content_between align_items_center  content-wrapper p_lr_20 m_b_20">
			<div class="flex align_items_center">
				<h2>新闻资讯</h2>
				<div class="p_l_20">
					<el-button size="small" type="primary" @click="add">新建资讯</el-button>
				</div>
			</div>
			<div>
				<Language></Language>
			</div>
		</div>

		<div class="content-wrapper p_20">
			<!-- -项目列表- -->
			<el-table :data='tableData' width='100%'>
				<el-table-column label='新闻时间' prop='newsdate'>
					<template slot-scope="scope">
						{{scope.row.newsdate}}
					</template>
				</el-table-column>
				<el-table-column label='置顶' prop='top'>
					<template slot-scope="scope">
						<span v-if="scope.row.top == 0">否</span>
						<span v-if="scope.row.top == 1">是</span>
					</template>
				</el-table-column>
				<el-table-column label='标题' prop='title'></el-table-column>
				<el-table-column label='操作' width="260" prop='title'>
					<template slot-scope="scope">
						<el-button size="small" @click="edit(scope.row)">编辑</el-button>
						<el-button size="small" @click="remove(scope.row)">删除</el-button>
					</template>
				</el-table-column>
			</el-table>
			<page ref="Page" :total="total"></page>
			<Edit ref="Edit"></Edit>
		</div>
	</div>
</template>
<script type="text/javascript">
	import methods from './method'
	import Edit from './edit/edit'

	export default {
		data() {
			return {
				tableData: [], //列表数据
				total: '', //数据总条数  
				language: 'cn',
				id: 1,
			}
		},
		methods: methods,
		components: {
			Edit
		},
		mounted() {
			this.getTableData()
		}
	}
</script>
